# -*- coding: UTF-8 _*_

import allure

from common.appbase import APPBase

loc = ('resourceId', 'com.hpbr.bosszhipin:id/tv_position_name')
titleloc=('resourceId',"com.hpbr.bosszhipin:id/tv_job_name")
hrloc=('resourceId','com.hpbr.bosszhipin:id/tv_boss_title')
# app测试111123
class JobPage():
    @allure.step("获取职位")
    def getjob1(self, driver, pagename='职位列表页', elename='职位title'):
        j = APPBase(driver)
        ele = j.findElements(locator=loc, pagename=pagename, elename=elename)
        return ele

    @allure.step('进入对应职位')
    def intojob(self, driver, ele='', pagename='职位列表页'):
        j = APPBase(driver)
        j.clickbyele(ele=ele, pagename=pagename,elename='职位title')

    @allure.step('获取对应职位title')
    def getjobtitle(self, driver, ele='', pagename='职位列表页'):
        j = APPBase(driver)
        title=j.gettextbyele(ele=ele, pagename=pagename, elename='职位title')
        return title

    @allure.step('获取职位详细')
    def getjobdes(self,driver,pagename='职位详情页'):
        j = APPBase(driver)
        jobtitle=j.gettext(locator=titleloc,pagename=pagename,elename='职位title')
        hr=j.gettext(locator=hrloc,pagename=pagename,elename='职位title')
        return jobtitle,hr
